

********************************************************************************
*Purpose: Calculate pathway scores underlying Figure 4 and 5 of the manuscript**
*Stata Version: 17
*By Marc van de Wardt (m.p.vande.wardt@vu.nl)
********************************************************************************

**Install additional packages needed

ssc install blindschemes, replace
net install blindschemes_fix, replace from("http://digital.cgdev.org/doc/stata/MO/Misc")

**Set working directory

cd "C:\Users\LT-054912\surfdrive\Diffusion\dataverse files\"

**Open log files\

log using "Stata commands to replicate figure 1.smcl", replace

use "rawdata.dta", clear

**Renaming some labels to make them consistent with the final labels used in mansucript
replace family_dynamic1="Christian conservatism" if family_dynamic1=="Protestants"
replace family_dynamic1="Unite language communities" if family_dynamic1=="Unite transborder language communities"
replace family_dynamic1="Christian conservatism" if family_dynamic1=="Protestants"
replace family_dynamic1="Anti-EU" if family_dynamic1=="Anti-Europe"
replace family_dynamic1="Pro-EU" if family_dynamic1=="Pro-Europe"
replace family_dynamic1="New Left" if family_dynamic1=="Other New Left"

keep if elec_year>=1961

bys family_dynamic1 elec_year: egen entryfamyear=sum(totentry2)
bys family_dynamic1 elec_year: gen i=_n
keep if i==1

keep family_dynamic1 elec_year entryfamyear

sort family_dynamic1
twoway line entryfamyear elec_year, by(family_dynamic1, col(7) iscale(0.37) note("")) scheme(plottig)  xtitle("") ytitle("") xsize(9) ysize(12) 
graph export "Figure1.tif", replace

log close